#ifndef COMMUNICATION_H
#define COMMUNICATION_H

#include <QObject>
#include <QString>
#include <QtNetwork/QtNetwork>
#include <QThread>
#include <ConnectionThread.h>
#include <AiboState.h>

class Communication : public QObject
{
    Q_OBJECT

public:
    explicit Communication(QObject* parent = 0);
    ~Communication();
    void connectToAibo(const QString& host, AiboState* state);
    void closeConnection();

    void sendCmd(const QByteArray& cmd);
    void sendWalkCmd(char type, float amount);
    void sendHeadPointCmd(char type, float amount);

    bool isTcpConnected();
    bool isWalkConnected();
    bool isHeadConnected();
    bool isBehaviorConnected();
    bool isJointMonitorConnected();
    bool isCameraConnected();

    QImage getCamera();

public slots:

private:
    QString m_host;
    ConnectionThread* m_connector;
};

#endif // COMMUNICATION_H
